package com.ihr360.cnb.module.insurance.service.feign;

import com.ihr360.cnb.module.insurance.service.feign.fallback.InsuranceMonthlyLedgerServiceFallback;
import com.ihr360.commons.vo.PageData;
import com.ihr360.excel.entity.ExportParams;
import com.ihr360.insurance.entity.request.StaffLedgerRequest;
import com.ihr360.insurance.entity.response.LedgerResponse;
import com.ihr360.insurance.entity.vo.StaffBenefitVo;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author Stone.Shi
 * @description
 * @date 2018-05-23 19:51:52.
 */
@FeignClient(name = "ihr360-insurance-provider", fallback = InsuranceMonthlyLedgerServiceFallback.class)
public interface InsuranceMonthlyLedgerService {

    /**
     * 按条件获取可添加到社保公积金台账中的员工数据
     *
     * @param companyId
     * @param userId
     * @param staffLedgerRequest
     * @return
     */
    @PostMapping(value = "/monthlyLedgers/getAddableList/", produces = MediaType.APPLICATION_JSON_VALUE)
    PageData<StaffBenefitVo> getAddableList(@RequestParam(value = "companyId") String companyId,
                                            @RequestParam(value = "userId") String userId,
                                            @RequestBody StaffLedgerRequest staffLedgerRequest);

    /**
     * 添加员工到台账
     *
     * @param companyId
     * @param userId
     * @param staffBenefits
     * @param ledgerYear
     * @param ledgerMonth
     * @return
     */
    @PostMapping(value = "/monthlyLedgers/staff/add", produces = MediaType.APPLICATION_JSON_VALUE)
    LedgerResponse addLedgerStaff(@RequestParam(value = "companyId") String companyId,
                                  @RequestParam(value = "userId") String userId,
                                  @RequestBody List<StaffBenefitVo> staffBenefits,
                                  @RequestParam(value = "ledgerYear") Integer ledgerYear,
                                  @RequestParam(value = "ledgerMonth") Integer ledgerMonth);

    /**
     * 获取导出的数据
     *
     * @param companyId
     * @param userId
     * @param requestString
     * @param departmentFullNames
     * @return
     */
    @PostMapping(value = "/monthlyLedgers/getExportData", produces = MediaType.APPLICATION_JSON_VALUE)
    ExportParams getExportData(@RequestParam(value = "companyId") String companyId,
                               @RequestParam(value = "userId") String userId,
                               @RequestParam(value = "requestString") String requestString,
                               @RequestBody Map<Long, String> departmentFullNames);
}
